package com.jgy.juc.callnable;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author 姜光远
 * @date 2023/3/4 17:09
 */
public class test {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        Callable_light callableLight = new Callable_light();
        FutureTask<Integer> futureTask = new FutureTask<>(callableLight);
        Thread thread = new Thread(futureTask);

        thread.setName("aaaaaaa");
        thread.start();
        Integer integer = futureTask.get();
        System.out.println(integer);
    }
}
